var xmlHttp

function getVote(selection,poll_id)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request")
	 return
	 } 
	var url="http://football.joshhughes.com/polls/poll_vote.php"
	
	url=url+"?vote="+selection
	url=url+"&sid="+Math.random()
	url=url+"&pollID="+poll_id
	xmlHttp.onreadystatechange=function(){
     if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
            document.getElementById("poll"+poll_id).innerHTML=xmlHttp.responseText;
        }
     };
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("poll").
 innerHTML=xmlHttp.responseText;
 } 
} 

function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	 {
	 objXMLHttp=new XMLHttpRequest()
	 }
	else if (window.ActiveXObject)
	 {
	 objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	 }
	return objXMLHttp
}